﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IHISCETeim.DAL;
using IHISCETeim.Model;
using IHISCETeim.Library;
using System.Data;

namespace IHISCETeim.BLL
{
    public class OUnsuitableProdController
    {
        /// <summary>
        /// 添加不适合品处理票
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="listImgs"></param>
        /// <param name="listDetail"></param>
        /// <returns></returns>
        public static int Add(OUnsuitableProdInfo obj, List<OUnsuitableProdImgInfo> listImgs, List<OUnsuitableProdDetailInfo> listDetail)
        {
            return OUnsuitableProdDAL.Add(obj, listImgs, listDetail);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="listImgs"></param>
        /// <param name="listDetail"></param>
        /// <returns></returns>
        public static bool Update(OUnsuitableProdInfo obj, List<OUnsuitableProdImgInfo> listImgs, List<OUnsuitableProdDetailInfo> listDetail)
        {
            return OUnsuitableProdDAL.Update(obj, listImgs, listDetail);
        }
          /// <summary>
        /// 工作完成情况修改
        /// </summary>
        /// <param name="UnsuitabledID"></param>
        /// <param name="IsComplete"></param>
        /// <returns></returns>
        public static bool UpdateIsComplete(int UnsuitabledID, string IsComplete)
        {
            return OUnsuitableProdDAL.UpdateIsComplete(UnsuitabledID, IsComplete);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="UnsuitabledID"></param>
        /// <returns></returns>
        public static bool Delete(int UnsuitabledID)
        {
            return OUnsuitableProdDAL.Delete(UnsuitabledID);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="UnsuitabledID"></param>
        /// <returns></returns>
        public static OUnsuitableProdInfo GetById(int UnsuitabledID)
        {
            return CBO.FillObject<OUnsuitableProdInfo>( OUnsuitableProdDAL.GetById(UnsuitabledID));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="whereSql"></param>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <param name="Sort"></param>
        /// <param name="TotalCount"></param>
        /// <returns></returns>
        public static DataTable GetPagination(string whereSql, int PageIndex, int PageSize, string Sort, ref int TotalCount)
        {
            return OUnsuitableProdDAL.GetPagination(whereSql, PageIndex, PageSize, Sort, ref  TotalCount);
        }

         /// <summary>
        /// 批量导出
        /// </summary>
        /// <param name="whereSql"></param>
        /// <returns></returns>
        public static DataTable GetBatchExportId(string whereSql)
        {
            return OUnsuitableProdDAL.GetBatchExportId(whereSql);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="UnsuitabledID"></param>
        /// <returns></returns>
        public static List<OUnsuitableProdDetailInfo> OUnsuitableProdDetail_GetAllByUnsuitabledID(int UnsuitabledID)
        {
            return CBO.FillCollection<OUnsuitableProdDetailInfo>(OUnsuitableProdDAL.OUnsuitableProdDetail_GetAllByUnsuitabledID(UnsuitabledID));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="UnsuitabledID"></param>
        /// <returns></returns>
        public static List<OUnsuitableProdImgInfo> OUnsuitableProdImg_GetAllByUnsuitabledID(int UnsuitabledID)
        {
            return CBO.FillCollection<OUnsuitableProdImgInfo>(OUnsuitableProdDAL.OUnsuitableProdImg_GetAllByUnsuitabledID(UnsuitabledID));
        }
        /// <summary>
        /// 添加供应商回复
        /// </summary>
        /// <param name="UnsuitabledID"></param>
        /// <param name="SupplerReplyFileName"></param>
        /// <param name="SupplerReplyFilePath"></param>
        /// <returns></returns>
        public static bool AddSupplerReply(int UnsuitabledID, string SupplerReplyFileName, string SupplerReplyFilePath,string ExcelJPFile, string ExcelJPFilePath)
        {
            return OUnsuitableProdDAL.AddSupplerReply(UnsuitabledID, SupplerReplyFileName, SupplerReplyFilePath, ExcelJPFile, ExcelJPFilePath);
        }
        /// <summary>
        /// 财务部修改
        ///索赔结算情况（C）			索赔收入差异(C-B)		不适合品物料处理方案
        /// </summary>
        public static bool UpdateClaim(OUnsuitableProdInfo obj)
        {
            return OUnsuitableProdDAL.UpdateClaim(obj);
        }
         /// <summary>
        /// 质管部修改
	    /// 提交金额	提交时间
        /// </summary>
        /// <param name="UnsuitabledID"></param>
        /// <param name="SubmitJinE"></param>
        /// <param name="SubmitDate"></param>
        /// <returns></returns>
        public static bool UpdateSubmit(int UnsuitabledID, decimal SubmitJinE, string SubmitDate)
        {
            return OUnsuitableProdDAL.UpdateSubmit(UnsuitabledID, SubmitJinE, SubmitDate);
        }
        /// <summary>
        /// IK不适合品相关修改
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static bool UpdateIK(OUnsuitableProdInfo obj)
        {
            return OUnsuitableProdDAL.UpdateIK(obj);
        }
    }
}
